package com.mmlc.inter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * @author king
 * @function FragmentPagerAdapter通用类
 * @date 2016-1-14上午9:41:21
 */
public class ViewPagerFragmentAdapter extends FragmentPagerAdapter {
    protected List<Fragment> fragments;

    public ViewPagerFragmentAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

}
